home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / DivX / VFW4048src / src / codec.h next >
Encoding:
C/C++ Source or Header  |  2001-02-21  |  2.5 KB  |  72 lines

  1. /**
  2. *  Copyright (C) 2000 - DivXNetworks
  3. **/
  4. // codec.h //
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef _CODEC_H_
  11. #define _CODEC_H_
  12.  
  13. class codec {
  14.     
  15. private:
  16.     float framerate;
  17.  
  18.     //operations
  19. public:
  20.     codec();
  21.     ~codec();
  22.     long about(LPARAM lParam1, LPARAM lParam2);
  23.     long config(LPARAM lParam1, LPARAM lParam2);
  24.     long getInfo(LPARAM lParam1, LPARAM lParam2);
  25.     long encGetFormat(LPARAM lParam1, LPARAM lParam2);
  26.     long encGetSize(LPARAM lParam1, LPARAM lParam2);
  27.     long encQuery(LPARAM lParam1, LPARAM lParam2);
  28.     long encFramesInfo(LPARAM lParam1, LPARAM lParam2);
  29.     long encBegin(LPARAM lParam1, LPARAM lParam2);
  30.     long encEncode(LPARAM lParam1, LPARAM lParam2);
  31.     long encEnd(LPARAM lParam1, LPARAM lParam2);
  32.     long decGetFormat(LPARAM lParam1, LPARAM lParam2);
  33.     long decQuery(LPARAM lParam1, LPARAM lParam2);
  34.     long decBegin(LPARAM lParam1, LPARAM lParam2);
  35.     long decDecode(LPARAM lParam1, LPARAM lParam2);
  36.     long decEnd(LPARAM lParam1, LPARAM lParam2);
  37.  
  38.     // decoder set
  39.     long decSetPostProcessing(LPARAM lParam1, LPARAM lParam2);
  40.  
  41. private:
  42.     int getImageType(BITMAPV4HEADER *bmpinfohdr);
  43.     void convertImage(void *imageIn, void *imageOut, long type, long x_dim, long y_dim);
  44.     void InitLookupTable();
  45.     int convertRGB (void *bmp, void *yuv, long type, long x_dim, long y_dim);
  46.     int convertYUV422 (void *yuv422, void *yuv, long type, long x_dim, long y_dim);
  47.     int convertYUV420 (void *yuv420, void *yuv, long type, long x_dim, long y_dim);
  48. };
  49.  
  50. #endif // _CODEC_H_
  51.  
  52. #include <vfw.h>
  53.  
  54. static const DWORD FOURCC_DIVX = mmioFOURCC('D','I','V','X');   // DivX format
  55. static const DWORD FOURCC_UYVY = mmioFOURCC('U','Y','V','Y');   // uncompressed UYVY
  56. static const DWORD FOURCC_YUY2 = mmioFOURCC('Y','U','Y','2');   // uncompressed YUY2
  57. static const DWORD FOURCC_YUYV = mmioFOURCC('Y','U','Y','V');   // uncompressed YUYV - same as YUY2
  58. static const DWORD FOURCC_V422 = mmioFOURCC('V','4','2','2');   // uncompressed V422 - same as YUY2
  59. static const DWORD FOURCC_YVYU = mmioFOURCC('Y','V','Y','U');   // uncompressed YVYU
  60. static const DWORD FOURCC_YV12 = mmioFOURCC('Y','V','1','2');   // uncompressed YV12 - MPEG format of choice
  61. static const DWORD FOURCC_I420 = mmioFOURCC('I','4','2','0');   // uncompressed I420
  62. static const DWORD FOURCC_IYUV = mmioFOURCC('I','Y','U','V');   // uncompressed IYUV - same as I420
  63.  
  64. extern long rc_period, bitrate;
  65. extern int search_range;
  66. extern int max_quantizer;
  67. extern int min_quantizer;
  68.  
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72.